package com.mowh.gof23.creational.patterns.factory.method.framework;

/**
 * @author mowh1gd
 * @create 2023/10/20 15:05
 */
public abstract class Factory {
    public final Product create(String owner) { //父类工厂已实现生成实例的功能逻辑，但产品的具体细节需由子类完成。该功能逻辑不允许子类修改。
        Product product = createProduct(owner);
        registerProduct(product);
        return product;
    }

    protected abstract Product createProduct(String owner);
    protected abstract void registerProduct(Product product);
}
